﻿using System;
using System.Collections.Generic;

using HtScrum.Service.Model;
using HtScrum.Service.Repository;

namespace HtScrum.Service.Locator
{
    public class RepositoryProviderFake : IRepositoryProvider
    {
        private Dictionary<Type, object> _repositoryCatalog;

        public RepositoryProviderFake()
        {
            this._repositoryCatalog = new Dictionary<Type, object>();
            this._repositoryCatalog.Add(typeof(IRepository<CustomerModel>), new CustomerRepositoryFake());
            this._repositoryCatalog.Add(typeof(IRepository<ProjectModel>), new ProjectRepositoryFake());
        }

        public TService GetInstance<TService>()
        {
            return (TService)this._repositoryCatalog[typeof(TService)];
        }

        public TService GetInstance<TService>(string key)
        {
            throw new NotImplementedException();
        }

        public IEnumerable<TService> GetAllInstances<TService>()
        {
            throw new NotImplementedException();
        }
    }
}
